package cn.eleven.common;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;


@Data
@AllArgsConstructor
@NoArgsConstructor
public class Result {
    public static final String SUCCESS= "0";
    public static final String ERROR= "-1";

    private String code;
    private String msg;

    private Object Data;

    public static Result success(){
        Result result=new Result();
        result.setCode(SUCCESS);
        return result;
    }

    public static Result success(Object obj){
        Result result=new Result();
        result.setCode(SUCCESS);
        result.setData(obj);
        return result;
    }

    public static Result error(String msg) {
        Result result = new Result();
        result.setCode(ERROR);
        result.setMsg(msg);
        return result;
    }



}

